from setux.core.deploy import Runner, Deployers


class Moduler(Runner):
    @property
    def label(self):
        return self.module

    def deploy(self):
        return self.target.deploy(self.module)


class Modules(Deployers):
    @property
    def label(self):
        return f'Modules {self.name}'

    @property
    def deployers(self):
        return [
            Moduler(self.target, module=module)
            for module in self.modules
        ]

